﻿Imports DTO
Public Class PhieuThueDAO
    Public Shared Function Them(ByVal pt As PhieuThue) As Integer
        Dim sql As String = "insert into PHIEUTHUE(NgayBatDauThue,MaPhong) values('" + pt.NgayBatDauThue + "'," + pt.MaPhong.ToString() + ")"
        Return Dataprovider.ExecuteNonQuery(sql)
    End Function
    Public Shared Function LayMaxMa() As Integer
        Return Integer.Parse(Dataprovider.ExecuteScalar("select max(MaPhieuThue) from PHIEUTHUE"))
    End Function
    Public Shared Function LayNgayThue(ByVal maphong As Integer) As Date
        Return Date.Parse(Dataprovider.ExecuteScalar("select NgayBatDauThue from PHIEUTHUE where" + maphong.ToString()))
    End Function
End Class
